package com.intellagric.controller.portal.traceability.trace_record;

import com.intellagric.common.pojo.LayuiDataGridResult;
import com.intellagric.common.pojo.ResponseMessage;
import com.intellagric.module.traceability.TransportRecordVo;
import com.intellagric.pojo.TraceRecordTransport;
import com.intellagric.service.traceability.trace_record.TransportrecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.UUID;

/**
 * @Author: zhy
 * @email: 1269679946@qq.com
 * @Date: 2019/1/13
 * @DESC： 运输记录管理
 */
@Controller
public class TransportrecordController {

    @Autowired
    private TransportrecordService transportrecordService;

    /**
     * 查询运输记录信息
     * @return TraceRecordTransport
     */
    @RequestMapping("/record/transport/{id}")
    @ResponseBody
    public TraceRecordTransport get(@PathVariable String id) {
        return transportrecordService.getTransportrecordById(id);
    }

    /**
     * 查询运输记录信息列表
     * @return LayuiDataGridResult
     */
    @RequestMapping("/record/transport/list")
    @ResponseBody
    public LayuiDataGridResult getList() {
        return transportrecordService.getTransportrecordList();
    }

    /**
     * 分页查询运输记录信息列表
     * @return LayuiDataGridResult
     */
    @RequestMapping("/record/transport/page")
    @ResponseBody
    public LayuiDataGridResult getPage(int page,int limit) {
        return transportrecordService.getTransportrecordPage(page, limit);
    }

    /**
     * 多条件分页查询运输记录信息列表
     * @return LayuiDataGridResult
     */
    @RequestMapping("/record/transport/query")
    @ResponseBody
    public LayuiDataGridResult getPageByVo(int page, int limit, TransportRecordVo transportRecordVo) {
        return transportrecordService.getTransportrecordPageByVo(page, limit,transportRecordVo);
    }

}
